package previous.Test_0409;

import java.util.Scanner;

/**
 * Created with Intellij IDEA
 * Description:
 * User: 星辰
 */
public class Solution {
    //顺子日期
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int[] month={0,31,28,31,30,31,30,31,31,30,31,30,31};

        int count=0;
        for(int i=1;i<=12;i++){
            for(int j=1;j<=month[i];j++){
                String s=String.format("2022%02d%02d",i,j);
                for ( int k = 0; k <= s.length()-3; k++) {
                    String sub=s.substring(k,k+3);
                    if((sub.charAt(1)-'0')==(sub.charAt(0)-'0')+1 && (sub.charAt(2)-'0')==(sub.charAt(1)-'0')+1){
                    count++;
                    break;
                    }
                }
                }
            }
        System.out.println(count);
        scan.close();}
    }

